package com.mew.chess.core.game.bjl.game.message;

import com.mew.chess.core.game.bjl.game.common.BjlConstantValue;
import com.zebra.common.ZebraBaseMessage;
import io.netty.buffer.ByteBuf;
import lombok.Data;
import lombok.ToString;

import java.util.List;
import java.util.Map;

/**
 * @author dylin
 * @create 2021/4/26
 */
@Data
@ToString
public class PushPaymentMessage extends ZebraBaseMessage<PushPaymentMessage> {
    private final int remainTime = BjlConstantValue.PAYMENT_TIME;

    private long payment;//赔付
    private long goldNumber;//背包金币

    private List<Integer> winList;
    private List<PaymentMessage> bigPlayerPayment;
    private List<HistoryMessage> historyMessageList;

    @Override
    public void write(ByteBuf b) {

        writeInt(b,remainTime);
        writeLong(b,payment);
        writeLong(b,goldNumber);
        writeInt(b,winList.size());
        for (Integer win : winList) {
            writeInt(b,win);
        }
        writeInt(b,bigPlayerPayment.size());
        for (PaymentMessage paymentMessage : bigPlayerPayment) {
            paymentMessage.write(b);
        }
        writeInt(b,historyMessageList.size());
        for (HistoryMessage historyMessage : historyMessageList) {
            historyMessage.write(b);
        }
    }

    @Override
    public PushPaymentMessage read(ByteBuf byteBuf) {
        return null;
    }
}
